{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<article>
		<div class="top-title">
			<dl>
				<dt><h1>{{.title}}</h1></dt>
			</dl>
		</div>
		<div class="content">
			<div class="release">
				<dl>
					<dt><i class="iconfont">&#xe649;</i> <b>{{.title}}说明</b><br>
						下方是{{.title}}列表,可以进行修改<br>
						<!-- <p>密码是MD5加密的,请不要使用此密码登录</p> -->
					</dt>
					<!-- <dd><a href="/admin/program/add"><button type="button" class="button">添加板块</button></a></dd> -->
				</dl>
			</div>
			<!-- 会员列表 -->
			<table class="table">
				<thead>
					<th width="15%">主图</th><th width="15%">名称</th><th width="25%">简介</th><th width="15%">添加时间</th><th width="15%">操作</th>
				</thead>	
				<tbody>
					{{ range .info }}
					<tr id="{{ .id }}">
						<td class="center">
							<img src="{{ if .pathname }}{{ .pathname }}{{ else }}/static/all/img-no.png{{ end }}" class="img-1" onerror="javascript:this.src='/static/img/admin/avatar.jpg'">
						</td>
						<td>
							{{ .name }}
						</td>
						<td>
							{{ .intr }}
						</td>
						<td>
							{{ .addtime }}
						</td>
						<td class="operation">
							<a href="/admin/indexBlock/edit?id={{ .id }}">编辑</a><br>
							<a class="del" data-id="{{ .id }}">{{ if eq .status "1" }}可见{{ else }}不可见{{ end }}</a>
						</td>
					</tr>
					{{ end }}
					{{ if ne .paginator.totalpages 1 }}
					<tr>
						<td colspan="5">
							<div class="paging">
								{{ if ne .paginator.currpage 1 }}
								<a href="{{ .url }}page={{ .paginator.firstpage }}">首页</a>
								<a href="{{ .url }}page={{ .paginator.prevpage }}">&lt;&lt;</a>
								{{ else }}
								<a class="disable">首页</a>
								<a class="disable">&lt;&lt;</a>
								{{ end }}
								{{ range $index,$page := .paginator.pages }}
									{{ if eq .paginator.currpage $page }}
									<a class="no">{{ $page }}</a>
									{{ else }}
									<a href="{{ $.url }}page={{ $page }}">{{ $page }}</a>
									{{ end }}
								{{ end }}
								{{ if eq .paginator.currpage .paginator.totalpages }}
								<a class="disable">&gt;&gt;</a>
								<a class="disable">尾页</a>
								{{ else }}
								<a href="{{ .url }}page={{ .paginator.nextpage }}">&gt;&gt;</a>
								<a href="{{ .url }}page={{ .paginator.totalpages }}">尾页</a>
								{{ end }}
							</div>
						</td>
					</tr>
					{{ end }}
				</tbody>
			</table>
		</div>
	</article>
</section>

<footer><!-- 系统监控内容 --></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
	$('.del').click(function () {
		var id = $(this).attr('data-id');
		var that = $(this)
		$.ajax({
			url: location.href,
			data: { table: 'mt_index_block', id: id },
			type: 'post',
			success: function (res) {
				if (res.status == 1) {
					showMessage('修改成功')
					var text = that.text() === '可见' ? '不可见' : '可见'
					that.html(text)
				} else {
					wxc.xcConfirm("操作失败,请重试", "error")
				}
			}
		})
	})
</script>
</body>
</html>
